<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>项目信息</title>
    <link href="../css/creat-pro.css" type="text/css" rel="stylesheet"/>
</head>
<body>
<!--header-->
<header id="header" class="header">
    <div class="header-info left"><i></i><a href="javascript:" onclick="toProDetail()">项目详情</a> > 项目信息</div>
    <div class="right-user right">
         <div class="clear t" >             <div id="headusername" class="role"></div>             <div class="icon"></div>         </div>
        <div class="head-down">
            <ul><li><a href="edit-pwd.html">修改密码</a></li><li><a onclick="loginOut()">退出系统</a></li></ul></div><div>
    </div>
    </div>
</header>
<!--menu-->
<aside id="aside" class="aside">
    <div class="logo">运营平台</div>
    <ul class="menu" id="asidemenu">
    </ul>
</aside>


<!--content-->
<div class="content">
    <div class="creat-pro">
        <div class="pro-head"><i></i>项目信息<a style="float:right;margin: 0 20px 0 0;cursor: pointer" onclick="edit()" id="edit">编辑</a></div>


        <table class="pro-table">
            <thead>
                <tr>
                    <th width="100">基本信息</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>医院全称</td>
                    <td id="name"></td>
                </tr>
                <tr>
                    <td>简称</td>
                    <td id="shortName"></td>
                </tr>
                <tr>
                    <td>别称</td>
                    <td id="alias"></td>
                </tr>
                <tr>
                    <td>Segmentation</td>
                    <td id="segmentation"></td>
                </tr>
                <tr>
                    <td>级别</td>
                    <td id="level"></td>
                </tr>

                <tr>
                    <td>有无高铁</td>
                    <td id="hsrEnable"></td>
                </tr>
                <tr>
                    <td>是否为百强医院</td>
                    <td id="isTopHundred"></td>
                </tr>
                <!--<tr>-->
                    <!--<td>邮编</td>-->
                    <!--<td id="postcode"></td>-->
                <!--</tr>-->
                <tr>
                    <td>床位</td>
                    <td id="bed"></td>
                </tr>
                <tr>
                    <td>年诊疗人次</td>
                    <td id="people"></td>
                </tr>
                
            </tbody>
            <thead>
                <tr>
                    <th width="100">地址信息</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>所属区域</td>
                    <td id="dis"></td>
                </tr>
                <tr>
                    <td>地址</td>
                    <td id="address"></td>
                </tr>
                <tr>
                    <td>设备科位置</td>
                    <td id="location"></td>
                </tr>
                <!--<tr>-->
                    <!--<td>维度</td>-->
                    <!--<td id="latitude"></td>-->
                <!--</tr>-->
                <!--<tr>-->
                    <!--<td>经度</td>-->
                    <!--<td id="longitude"></td>-->
                <!--</tr>-->
            </tbody>
            <tbody>
                <tr>
                    <td></td>
                    <!--<td><a class="pro-btn pro-sure" >提交</a></td>-->
                </tr>
            </tbody>
        </table>
    </div>
</div>
<script src='../js/jquery.min.js'  type="text/javascript"></script>
<script src="../js/jquery.cookie.js"></script>
<script src="../js/user-tree.js" type="text/javascript"></script>
<script src="../js/common.js"></script>

<script type="text/javascript">

    //权限控制
    var roleid = $.cookie('userrole');
    function forbidenOpe() {}
    forbidenOpe.prototype = {
        init:function(){
            this.mark = false;
            this.userId = $.cookie('userid');
            this.ismember()
        },
        ismember:function() {
            var that = this;
            var url  = _ip+'/puser/select';
            var data = {
                id: getUrlId()
            };
            var arr = [];
            organizeAjaxGet(url, data, 'tttt', function(json) {
                if (json.success) {
                    arr.push(json.data.owner.id);
                    for(var k = 0; k < json.data.list.length; k++){
                        arr.push(json.data.list[k].id);
                    }
                    var isProMember = false;
                    for(var n = 0; n < arr.length; n++){
                        if(that.userId == arr[n]){
                            isProMember = true;
                            break;
                        }
                    }
                    if(roleid == 9 || roleid==3 ){
                        that.mark = true;
                    }
                    if(roleid ==0){
                        that.mark == false;
                    }
                    if( roleid == 1 && json.data.owner.id ==  that.userId  ){
                        that.mark = true;
                    }
                    if( roleid == 2 && isProMember){
                        that.mark = true;
                    }
                    if(!that.mark){
                        $('#edit').remove();
                    }

                }

            })
        }
    }
    forbidenOpe =  new forbidenOpe()
    forbidenOpe.init();


    function  edit() {
        location.href = 'mems-pro-baseInfo-edite.html?id='+getUrlId()+'&name='+$$.getUrlParaObj()['name'];
    }
    function toProDetail() {
        location.href = 'mems-pro-detail-baseinfo.html?id='+getUrlId()+'&name='+$$.getUrlParaObj()['name'];
    }
    getItem()
    function getItem() {

        var url  = _ip+'/project/select?id='+getUrlId();
        var data = {

        }
        $.ajax({
            url:url,
            type: 'GET',
            dataType: 'jsonp',
            async:false,
            contentType:'application/json',
            jsonpCallback: 'info',
            success:function(data){
                if(data.message === 'LOGIN') {
                    location.href = 'user-login.html';
                    return false;
                }

                if(data.success){
                    var data = data.data;
                    $('#name').html(data.name) ;
                    $('#shortName').html(data.shortName);
                    $('#alias').html(data.alias);
                    $('#segmentation').html(data.segmentation);
                    $('#level').html(data.level);
                    $('#hsrEnable').html( (data.hsrEnable==1?'有':'无') );
                    $('#isTopHundred').html( (data.isTopHundred==1?'是':'否') );
//                    $('#postcode').html(data.postcode);
                    $('#bed').html(data.bed);
                    $('#people').html(data.people);
                    $('#dis').html(data.area+data.province+data.city);
                    $('#address').html(data.address);
                    $('#location').html(data.location);
//                    $('#latitude').html(data.latitude);
//                    $('#longitude').html(data.longitude);


                }
            }
        })
   }
</script>
</body>
</html>